/*******************************************************************************************
 *  Accel.c
 *
 *  Creating and managing Accel object strucutres.
 *
 *******************************************************************************************/







/*******************************************************************************************
 *  INCLUDES :
 *******************************************************************************************/

/* System and library related : */
#include <stdlib.h>
#include <string.h>

/* Project related : */
#include "Accel.h"







/*******************************************************************************************
 *  FUNCTIONS :
 *******************************************************************************************/

/*******************************************************************************************
 *  NEWACCEL : Creates an empty Accel object structure.
 *******************************************************************************************/
Accel *newAccel(void) {
	Accel *a;

	/* Creating the container structure : */
	a = (Accel *)malloc(sizeof(Accel));


	/* Setting the object's type : */
	a->otype = accel;


	/* Returning the still empty structure : */
	return a;

}




/*******************************************************************************************
 *  FREEACCEL : destroys an Accel object structure and all the objects it stores.
 *******************************************************************************************/
void freeAccel(Accel *a) {

	free(a->term);

	free(a->horizontal);
	free(a->vertical);

	free(a);

}



/*******************************************************************************************
 *  SETACCELSPEED : set the Accel object's term parameter.
 *******************************************************************************************/
void setAccelTerm(Accel *a, char *t) {
	a->term = t;
}



/*******************************************************************************************
 *  SETACCELVERTICAL : set the Accel object's vertical object.
 *******************************************************************************************/
void setAccelVertical(Accel *a, Vertical *v) {
	a->vertical = v;
}



/*******************************************************************************************
 *  SETACCELHORIZONTAL : set the Accel object's horizontal object.
 *******************************************************************************************/
void setAccelHorizontal(Accel *a, Horizontal *h) {
	a->horizontal = h;
}
